1. Field of the Invention
The present invention relates to an image processor that acquires displacement of superimposed images in a multiple image in which acquired images of a subject are superimposed on each other, an image acquisition apparatus including this image processor, and a storage medium storing an image processing program allowing a computer to function as such an image processor.
It should be noted that a “multiple image” in this specification represents general images in which images of a subject are superimposed on each other. Specifically, it represents: an image acquired when an image acquisition apparatus forms images of a subject in a superimposed manner; a ghost image in which images of a subject are superimposed because of an electronic or an optical function; a flare image; an image in which images of a subject are multiply-layered because of a failure in positioning processing when a plurality of images are positioned and superimposed on each other; and others. Further, “multiple” means a state where images are at least partially superimposed on each other.
2. Description of the Related Art
There is proposed a technology that includes a mechanism that acquires images of a subject in a superimposed manner in an image acquiring apparatus such as a camera, acquires images of the subject in the form of a multiple image, and measures displacement between superimposed images in the multiple image to measure a distance to the subject when acquiring the image by the image acquisition apparatus. For example, Jpn. Pat. Appln. KOKAI Publication No. 2006-329897 discloses a technique that uses a double image reflected on a transparent plate to measure a distance. Jpn. Pat. Appln. KOKAI Publication No. 7-135597 discloses a technique that acquires a double image by utilizing a diaphragm having a plurality of apertures to acquire a double image to measure a distance.
According to both inter-image displacement amount measuring methods in the above-explained two technologies, an auto-correlation function is calculated, and a second peak is sought to measure an inter-image displacement amount.
An example of a calculating formula for an auto-correlation function is as follows:
                    y        2            ⁡              (        i        )              =                  y        1            ⁡              (                  i          +          τ                )                        R      ⁡              (        τ        )              =                                                                      ∑                                  i                  ∈                  Ω                                                                                              ⁢                                                          ⁢                              (                                                                            y                      1                                        ⁡                                          (                      i                      )                                                        -                                                            y                      _                                        1                                                  )                                                                                                                    ⁢                              (                                                                            y                      2                                        ⁡                                          (                      i                      )                                                        -                                                            y                      _                                        2                                                  )                                                                                                                                      ∑                                      i                    ∈                    Ω                                                                                                          ⁢                                                                  ⁢                                                      (                                                                                            y                          1                                                ⁡                                                  (                          i                          )                                                                    -                                                                        y                          _                                                1                                                              )                                    2                                                                                                      ∑                                      i                    ∈                    Ω                                                                                                          ⁢                                                                  ⁢                                                      (                                                                                            y                          2                                                ⁡                                                  (                          i                          )                                                                    -                                                                        y                          _                                                2                                                              )                                    2                                                                        wherein, each of y1 and y2 is each image of the superimposed images displaced by an amount τ, i is an image coordinate, Ω is a calculation range, and each of y1 and y2 is an average value in the calculation range for y1 or y2.
FIG. 1 shows an example of an auto-correlation function.
After calculating such an auto-correlation function, a displacement mount between superimposed images is calculated by detecting a second peak representing a correlation value between superimposed images.
It should be noted that the auto-correlation function is calculated in a one-dimensional space here. For example, when a direction of displacement between images in a multiple image is already known, a displacement amount between the images can be sought based on one-dimensional search along a direction of the displacement between the images. A direction of displacement between images can be obtained in advance by an optical calibration technique if such a structure that a double image reflected on a transparent plate is acquired as disclosed in Jpn. Pat. Appln. KOKAI Publication No. 2006-329897 is adopted, and hence this structure is utilized. When a direction of displacement between images in a multiple image is unknown, searching for an auto-correlation function value in two-dimensional space and detecting a second peak can suffice.